<script setup>
import { ref,onMounted } from 'vue'
import TestCom from '@/components/test-com.vue'

const inp = ref(null)

onMounted(()=>{
    console.log(inp.value)
    inp.value.focus()
})
const clickFn = () => {
    inp.value.focus()
}

const testCom = ref(null)
const getSon = () => {
    console.log(testCom.value)
}


</script>

<template>
    <input type="text" ref="inp">
    <button @click="clickFn">提交</button>
    <TestCom ref="testCom"></TestCom>
    <button @click="getSon">获取子组件</button>
</template>